package com.meta.platform.oplog.aop;

/**
 * @author: Rui.Zhou
 * @date: 2018/5/29
 * @Description: 日志对象
 */
public class OpreateLog {

    private String apiUrl;
    /**
     * 访问接口类名称和方法
     */
    private String apiClassMethodName;
    /**
     * 访问接口具体方法
     */
    private String reqMethod;
    /**
     * 操作时间
     */
    private Long operTime;
    /**
     * 请求参数体 (JSON格式)
     */
    private String reqParam;

    /**
     * 请求返回体
     */
    private Object resp;
    /**
     * 请求耗时
     */
    private Long reqEndTime;

    /**
     * 记录简单日志的标题
     */
    private String title;
    /**
     * 记录简单日志的具体信息
     */
    private String msg;

    /**
     * 方案ID
     */
    private Long solutionId;

    /**
     * 操作用户的ID
     */
    private Long userId;

    /**
     * 客户端请求IP
     */
    private String ip;
    public OpreateLog(){};
    public OpreateLog(String apiUrl,String apiClassMethodName, String reqMethod, String ip,Long operTime, String reqParam) {
        this.apiUrl = apiUrl;
        this.apiClassMethodName = apiClassMethodName;
        this.reqMethod = reqMethod;
        this.operTime = operTime;
        this.reqParam = reqParam;
        this.ip = ip;
        this.title = apiClassMethodName;
        this.msg = "Ctrl请求日志";
    }

    public OpreateLog(String title,String msg){
        this.title = title;
        this.msg = msg;
        this.operTime = System.currentTimeMillis() / 1000;
    }

    public String getApiClassMethodName() {
        return apiClassMethodName;
    }

    public void setApiClassMethodName(String apiClassMethodName) {
        this.apiClassMethodName = apiClassMethodName;
    }

    public String getReqMethod() {
        return reqMethod;
    }

    public void setReqMethod(String reqMethod) {
        this.reqMethod = reqMethod;
    }

    public Long getOperTime() {
        return operTime;
    }

    public void setOperTime(Long operTime) {
        this.operTime = operTime;
    }

    public String getReqParam() {
        return reqParam;
    }

    public void setReqParam(String reqParam) {
        this.reqParam = reqParam;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getApiUrl() {
        return apiUrl;
    }

    public void setApiUrl(String apiUrl) {
        this.apiUrl = apiUrl;
    }

    public Object getResp() {
        return resp;
    }

    public void setResp(Object resp) {
        this.resp = resp;
    }

    public Long getReqEndTime() {
        return reqEndTime;
    }

    public void setReqEndTime(Long reqEndTime) {
        this.reqEndTime = reqEndTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Long getSolutionId() {
        return solutionId;
    }

    public void setSolutionId(Long solutionId) {
        this.solutionId = solutionId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
}